/**
 * 
 */
package com.hanhai.zrb.api.biz.dao.mybatis;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;

import com.hanhai.zrb.api.biz.dao.mybatis.base.BaseMapper;

import com.hanhai.zrb.model.message.MessageInfo;

/**
 * @author ricky
 *
 */
public interface MessageInfoDao extends BaseMapper{

	@SelectKey(statement="select LAST_INSERT_ID()", keyProperty="id", keyColumn="id",before=false, resultType=long.class)
	@Insert("insert into message_info (content,type,typeName,bizType,bizKey,senderUid,senderUname,createTime,status)values(#{content},#{type},#{typeName},#{bizType},#{bizKey},#{senderUid},#{senderUname},#{createTime},#{status})")
	void save(MessageInfo messageInfo);
	
	@Select("select id,content,type,typeName,bizType,bizKey,senderUid,senderUname,createTime,status from message_info where id = #{id}")
	MessageInfo queryOne(Long id);
	
	List<MessageInfo> queryByIdList(@Param("idList") List<Long> idList);
	
	List<MessageInfo> queryBySenderUid(@Param("senderUid") Long senderUid);
	
}
